<h2 class="hide">表单列表</h2>
<div id="matrix-form-list"
     class="base-list"
     data-topple="hsList"
     data-load-url="centra/matrix/form/list.act?furl_id=${furl_id}&amp;ob=boost!&amp;ab=_text"
     data-send-urls-0="['centra/matrix/form/delete.act','.delete','您确定要删除此表单?']"
     data-open-urls-0="['centra/matrix/form/form.html?furl_id=${furl_id}','.create','@']"
     data-open-urls-1="['centra/matrix/form/form.html?id={ID}','.modify','@']">
    <form class="findbox toolbox board row" action="" method="POST">
        <div class="col-xs-7">
            <div class="btn-group">
                <button type="button" class="create btn btn-default">创建表单</button>
                <button type="button" class="modify for-choose btn btn-default">修改</button>
                <button type="button" class="delete for-checks btn btn-default" title="删除"><span class="bi bi-hi-remove text-danger"></span></button>
            </div>
        </div>
        <div class="col-xs-5">
            <div class="input-group">
                <input type="search" name="wd" class="form-control input-search"/>
                <span class="input-group-btn">
                    <button type="submit" class="submit btn btn-default"><span class="bi bi-hi-search"></span></button>
                    <button type="button" class="manual btn btn-default"><span class="bi bi-hi-manual"></span></button>
                </span>
            </div>
        </div>
    </form>
    <div class="listbox panel panel-default table-responsive">
        <table class="table table-hover table-striped table-compressed">
            <thead>
                <tr>
                    <th data-fn="id[]" data-ft="_check" class="_check">
                        <input type="checkbox" class="checkall" name="id[]"/>
                    </th>
                    <th data-fn="_" data-ft="_admin" class="_admin _amenu">
                        <div class="dropdown invisible">
                            <a href="javascript:;" data-toggle="dropdown"><span class="bi bi-hi-action"></span></a>
                            <ul class="dropdown-menu">
                                <li><a href="javascript:;" class="modify">修改</a></li>
                                <li><a href="javascript:;" class="delete"><span class="text-danger">删除</span></a></li>
                            </ul>
                        </div>
                    </th>
                    <th data-fn="name"  class="sortable text-left" >名称</th>
                    <th data-fn="boost" class="sortable text-right">权重</th>
                    <th data-fn="state_text" class="sortable">状态</th>
                    <th data-fn="mtime" data-ft="_htime" data-fill="v*1000" class="_htime sortable">修改时间</th>
                    <th data-fn="ctime" data-ft="_htime" data-fill="v*1000" class="_htime sortable">创建时间</th>
                </tr>
            </thead>
            <tbody>
            </tbody>
        </table>
    </div>
    <div class="pagebox clearfix"><em class="page-text">...</em></div>

    <div class="modal fade in" style="z-index: 99999; display: none;">
        <div class="modal-dialog modal-md">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal">&times;</button>
                    <h4 class="modal-title">帮助</h4>
                </div>
                <div class="modal-body">
                    <p>
                        请选择单元来管理表单，无单元请先添加单元；
                        顶层下单元为一级菜单，其下表单为二级菜单；
                        二层及以下的单元将用作隐藏数据不显示菜单。
                    </p>
                    <p>
                        添加表单后需要刷新当前页面才能看到其菜单，
                        可在用户单元中将权限分配给其他用户或部门。
                    </p>
                    <p>
                        表单基础设置中, "内部"表示仅在后台可以使用, "外部"表示可以对外公开使用, "开放(仅接口)"表示对外公开但无页面;
                        字段基础设置中, "搜寻"表示可通过搜索框查到, "搜索"表示过滤时用模糊匹配, "筛选"和"统计"会在列表上对应的地方.
                    </p>
                    <p>
                        表单高级设置中, 用'<b>:</b>'开头的键设置安全值, 用'<b>.</b>'开头的键设置预置值;
                        字段高级设置中, 用'<b>:</b>'开头的键设置枚举值, 可为数字类型指定统计区间并命名.
                        <i>(符号不含引号)</i>
                    </p>
                    <p>
                        表单操作可参阅表单设置中的字段区下方说明。
                        <b>祝您使用愉快！</b>
                    </p>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    (function($) {
        var context = $('#matrix-form-list');
        var helpBox = context.find(".modal");
        var srchInp = context.find(".findbox [type=search]");
        var loadBox = context.closest(".loadbox");

        // 根节点搜全部
        if (hsGetSeria(hsSerialArr(loadBox), "furl_id") === '0') {
            srchInp.after('<input type="hidden" name="furl_id" value="0">');
            srchInp.attr ("placeholder" , "可以搜全部表单哦");
            srchInp.on   ("change" , function () {
                $(this).next().val($(this).val() ? "" : "0");
            } );
        }

        // 标红冻结的行
        context.data("_fill_state_text", function(td, v) {
            if (this._info.state == 8) {
                td.closest("tr").css("color", "#ff0000");
            }
            return v;
        });

        // 打开帮助信息
        context.find( ".manual" ).click( function() {
            helpBox.modal("show");
        }); helpBox.modal("hide");
    })(jQuery);
</script>